/* 主容器 */
.container {
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px 16px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.title {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
}

.headerRight {
    display: flex;
    align-items: center;
    gap: 12px;
}

.searchBar {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 20px;
    padding: 8px 16px;
    gap: 8px;
    min-width: 120px;
}

.searchIcon {
    font-size: 14px;
    color: #999;
}

.searchText {
    font-size: 14px;
    color: #999;
}

.settingsIcon {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.settingsIcon:hover {
    background-color: #f0f0f0;
}

/* 菜单容器 */
.menuContainer {
    position: relative;
}

.dropdownMenu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 150px;
    margin-top: 4px;
    animation: fadeIn 0.2s ease-in-out;
}

.menuItem {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.menuItem:last-child {
    border-bottom: none;
}

.menuItem:hover {
    background-color: #f5f5f5;
}

/* 学校选择器 */
.schoolSelector {
    padding: 12px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.schoolSelectorLabel {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.schoolSelect {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #ffffff;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

.schoolSelect:focus {
    border-color: #007aff;
}

/* 功能图标区域 */
.iconRow {
    display: flex;
    justify-content: space-around;
    padding: 20px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.iconItem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fansIcon {
    background-color: #ffd700;
}

.mentionsIcon {
    background-color: #4a90e2;
}

.commentsIcon {
    background-color: #9c27b0;
}

.likesIcon {
    background-color: #f44336;
}

.iconSymbol {
    font-size: 20px;
    color: #ffffff;
}

.iconLabel {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

/* 标签页容器 */
.tabContainer {
    display: flex;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    color: #007aff;
}

.activeTab {
    color: #007aff;
    border-bottom-color: #007aff;
}

/* 用户列表区域 */
.userList {
    flex: 1;
    background-color: #ffffff;
    overflow-y: auto;
    padding: 0 16px;
}

/* 群聊列表区域 */
.groupList {
    flex: 1;
    background-color: #ffffff;
    overflow-y: auto;
    padding: 0 16px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loadingText {
    font-size: 14px;
    color: #666;
}

.emptyState {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.emptyText {
    font-size: 14px;
    color: #666;
}

.errorState {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
    gap: 16px;
}

.errorText {
    font-size: 14px;
    color: #f44336;
    text-align: center;
    max-width: 80%;
}

.retryButton {
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.retryButton:hover {
    background-color: #0056cc;
}

.userItem {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.userItem:hover {
    background-color: #f8f8f8;
}

.userAvatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.userAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.defaultUserAvatar {
    width: 100%;
    height: 100%;
    background-color: #007aff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.userInfo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.userName {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
}

.userStudentId {
    font-size: 12px;
    color: #666;
}

.userSignature {
    font-size: 12px;
    color: #999;
    font-style: italic;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.userAction {
    display: flex;
    align-items: center;
}

.chatButton {
    font-size: 20px;
    color: #007aff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chatButton:hover {
    background-color: #f0f0f0;
}

/* 群聊项样式 */
.groupItem {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.groupItem:hover {
    background-color: #f8f8f8;
}

.groupAvatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.defaultGroupAvatar {
    width: 100%;
    height: 100%;
    background-color: #28a745;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.groupInfo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.groupName {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
}

.groupMembers {
    font-size: 12px;
    color: #666;
}

.groupTime {
    font-size: 12px;
    color: #999;
}

.groupAction {
    display: flex;
    align-items: center;
}

/* 未读消息徽章 */
.unreadBadge {
    background-color: #ff3b30;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

/* 创建群聊弹窗 */
.modalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-in-out;
}

.modal {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modalHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modalHeader h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #000000;
}

.closeButton {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.closeButton:hover {
    background-color: #f0f0f0;
}

.modalContent {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.inputGroup {
    margin-bottom: 20px;
}

.inputGroup label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: #007aff;
}

.userSelection {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.userSelectionItem {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.userSelectionItem:last-child {
    border-bottom: none;
}

.userSelectionItem:hover {
    background-color: #f8f8f8;
}

.userSelectionItem.selected {
    background-color: #e3f2fd;
}

.userSelectionAvatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.userSelectionAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.userSelectionName {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.checkmark {
    color: #007aff;
    font-weight: bold;
    font-size: 16px;
}

.modalFooter {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.cancelButton {
    flex: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancelButton:hover {
    background-color: #f5f5f5;
}

.createButton {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #007aff;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.createButton:hover {
    background-color: #0056cc;
}

/* 滚动条样式 */
.userList::-webkit-scrollbar,
.groupList::-webkit-scrollbar,
.userSelection::-webkit-scrollbar {
    width: 4px;
}

.userList::-webkit-scrollbar-track,
.groupList::-webkit-scrollbar-track,
.userSelection::-webkit-scrollbar-track {
    background: transparent;
}

.userList::-webkit-scrollbar-thumb,
.groupList::-webkit-scrollbar-thumb,
.userSelection::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.userList::-webkit-scrollbar-thumb:hover,
.groupList::-webkit-scrollbar-thumb:hover,
.userSelection::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 16px 12px 12px 12px;
    }
    
    .title {
        font-size: 18px;
    }
    
    .searchBar {
        min-width: 100px;
        padding: 6px 12px;
    }
    
    .dropdownMenu {
        min-width: 130px;
    }
    
    .menuItem {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .iconRow {
        padding: 16px 12px;
    }
    
    .icon {
        width: 45px;
        height: 45px;
    }
    
    .iconSymbol {
        font-size: 18px;
    }
    
    .userList,
    .groupList {
        padding: 0 12px;
    }
    
    .userItem,
    .groupItem {
        padding: 12px 0;
    }
    
    .userAvatar,
    .groupAvatar {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }
    
    .userName,
    .groupName {
        font-size: 15px;
    }
    
    .userStudentId,
    .groupMembers {
        font-size: 11px;
    }
    
    .userSignature,
    .groupTime {
        font-size: 11px;
    }
    
    .modal {
        width: 95%;
        margin: 20px;
    }
    
    .modalContent {
        max-height: 50vh;
    }
}